{include file="header.html"}
<div id="page_main" class="main-right">
  <div id="rightTop">
    <p>{$lang.appmarket}</p>
    <ul class="subnav">
      <li><span>{$lang.manage}</span></li>
      <li><a class="btn1" href="{url route='appmarket/add'}">{$lang.add}</a></li>
    </ul>
  </div>
  <div id="flexigrid"></div>
</div>
<script type="text/javascript">
$(function(){
    $("#flexigrid").flexigrid({
    	url: url(['appmarket/index']),
    	colModel : [
    		{ display: '{$lang.operation}', name : 'operation', width : 100, sortable : false, align: 'center', className: 'handle'},
			{ display: '{$lang.name}', name : 'name', width : 150, sortable : false, align: 'center'},
			{ display: '{$lang.logo}', name : 'logo', width : 80, sortable : true, align: 'center'},
    		{ display: '{$lang.title}', name : 'title', width : 150, sortable : true, align: 'center'},
			{ display: '{$lang.category}', name : 'category', width : 100, sortable : true, align: 'center'},
    		{ display: '{$lang.charge}', name : 'charge', width : 100, sortable : false, align: 'center'}, 
			{ display: '{$lang.period}', name : 'period', width : 300, sortable : false, align: 'center'},    		
			{ display: '{$lang.sales}', name : 'sales', width: 50, sortable : true, align : 'center'},
			{ display: '{$lang.purchase}', name : 'purchase', width: 80, sortable : true, align : 'center'},
			{ display: '{$lang.status}', name : 'status', width: 80, sortable : true, align : 'center'}		
    	],
        buttons : [
            { display: '<i class="fa fa-trash"></i>{$lang.batch_del}', name : 'del', bclass : 'del', title : '{$lang.batch_del_for_selected}', onpress : fg_operate }
        ],
		sortname: "aid",
    	sortorder: "desc",
    	title: '{$lang.appmarket_list}'
    });
});
function fg_operate(name, bDiv) {
	var itemlist = new Array();
	$('.trSelected',bDiv).each(function(){
		itemlist.push($(this).attr('data-id'));
	});
	if (name == 'del') {
	   if($('.trSelected',bDiv).length == 0){
			layer.msg(lang.no_selected_item);
			return false;
	   }
       fg_delete(itemlist,'appmarket');
	}
}
</script> 
{include file="footer.html"} 